from django.db import models

# Create your models here.

from meiduo_mall.utils.models import BaseModel  # 从meiduo_mall下面开始导入
from users.models import User  # 从apps下面导入


# Create your models here.
class OAuthQQUser(BaseModel):  # 继承模型类补充字段
    """ QQ登录用户数据模型 """
                                    # 外键删除 级联删除
    user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name='用户')
                                                                    # 索引追踪 开启
    openid = models.CharField(max_length=64, verbose_name='openid', db_index=True)

    # 元类
    class Meta:
        # 表名
        db_table = 'tb_oauth_qq'
        verbose_name = 'QQ登录用户数据'
        verbose_name_plural = verbose_name
